/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package uns.fit.gis.serviceapp;

import java.util.Calendar;
import java.util.Timer;
import java.util.TimerTask;

/**
 *
 * @author Ninh
 */
public class task extends TimerTask{
    private Service1Soap_Stub service;
    private String[] result;
    private String imei;
    private String cellid;
    private Calendar c;
    private String time;

    public task(Service1Soap_Stub ser){
        this.service = ser;
        this.cellid = "";
        this.imei = "";
        this.time = "";
    }

    public String getCellID(){
        return cellid;
    }
    
    public String getImei(){
        return imei;
    }

    public String[] getResult(){
        return result;
    }

    public String getTime(){
        return time;
    }

    public void run(){
        try {
            c = Calendar.getInstance();
            cellid = System.getProperty("com.nokia.mid.cellid");
            imei = System.getProperty("com.nokia.mid.imei");
            time = c.get(Calendar.HOUR_OF_DAY) + ":" + c.get(Calendar.MINUTE) + ":" + c.get(Calendar.SECOND);
            //ArrayOfString arr = service.search("352023047599432", 237281393, time);
            ArrayOfString arr = service.search(imei, Integer.parseInt(cellid), time);
            result = arr.getString();
        } catch (Exception e) {
        }
    }
}
